package com.bw.unit3.db

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy.REPLACE
import androidx.room.Query
import com.bw.unit3.bean.LoginBean

/**
 *
 * @ClassName: LoginDao
 * @Description: 提供login表增删改查 的方法
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/13 11:58 AM
 * @Version: 1.0
 */
@Dao
interface LoginDao {
    //添加
    @Insert(onConflict = REPLACE)// 处理重复添加
    fun insertLogin(loginBean: LoginBean)

    @Query("select * from login_bean")
    fun getLoginBean(): LoginBean

//查询列表
//    @Query("select * from login_bean")
//    fun getLoginBeans(): List<LoginBean>

    @Query("delete from login_bean")
    fun deleteLogin()
}